package app.server.project.core.token;

import lombok.AllArgsConstructor;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class TokenCache {



    private ConcurrentHashMap<Long,String> map=new ConcurrentHashMap<>();

    public String getToken(long userId){
        return map.get(userId);
    }


    public String addToken(long userId,String token){
        this.map.put(userId,token);
        return token;
    }
}
